package com.xbongbong.paas.model.impl;

import com.xbongbong.paas.domain.dao.AttrTrashDao;
import com.xbongbong.paas.domain.entity.AttrTrashEntity;
import com.xbongbong.paas.model.AttrTrashModel;
import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
 *
 * @author 魏荣杰
 * @date 2021/3/2 15:11
 * @since
 * @version
 */
@Service("attrTrashModelImpl")
public class AttrTrashModelImpl implements AttrTrashModel {

    @Resource
    private AttrTrashDao attrTrashDao;

    @Override
    public Integer insert(AttrTrashEntity entity) {
        long now = DateTimeUtil.getInt();
        entity.setAddTime(now);
        entity.setUpdateTime(now);
        return attrTrashDao.insert(entity);
    }

    @Override
    public Integer update(AttrTrashEntity entity) {
        long now = DateTimeUtil.getInt();
        entity.setUpdateTime(now);
        return attrTrashDao.update(entity);
    }

    @Override
    public Integer deleteByKey(Long key, String corpid) {
        return attrTrashDao.deleteByKey(key, corpid);
    }

    @Override
    public List<AttrTrashEntity> insertBatch(List<AttrTrashEntity> attrTrashEntityList) {
        attrTrashDao.insertBatch(attrTrashEntityList);
        return attrTrashEntityList;
    }

    @Override
    public List<AttrTrashEntity> findEntitys(Map<String, Object> param) {
        return attrTrashDao.findEntitys(param);
    }

    @Override
    public List<AttrTrashEntity> updateBatch(List<AttrTrashEntity> attrTrashEntityList, String corpid) {
        attrTrashDao.updateBatch(attrTrashEntityList, corpid);
        return attrTrashEntityList;
    }

    @Override
    public Integer deleteBatch(List<Long> idIn, String corpid) {
        return attrTrashDao.deleteBatch(idIn, corpid);
    }

    @Override
    public AttrTrashEntity getByKey(Long key, String corpid) {
        return attrTrashDao.getByKey(key, corpid);
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> param) {
        return attrTrashDao.getEntitysCount(param);
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return null;
    }
}
